#include "headfiles.h"

using namespace std;

int main(int argc, char **argv) {
    if (argc != 3) {
        cout << "Usage: " << argv[0] << " file val" << endl;
        return 0;
    }

    string file_name(argv[1]);
    int val = atoi(argv[2]);

    NODE *head = createLinkedList(file_name.c_str());
    if (head == NULL) {
        cout << "Empty linked list!" << endl;
        return 0;
    }

    // print linked list
    cout << "Original linked list is" << endl;
    printCycleLinkedList(head);

    head = cycleLinkedListInsertion(head, val);

    cout << "Inserted linked list is:" << endl;
    printCycleLinkedList(head);

    destroyCycleLinkedList(head);

    return 0;
}
